﻿using System;
using System.Text;

namespace dotHTML.HTML {
    /// <summary>
    /// Represents a root HTML element (&lt;html&gt;).
    /// </summary>
    [Serializable]
    public class Html : Element {
        private string _manifest;
        private string _version;

        /// <summary>
        /// Determines the URL of the manifest that instructs the client on how
        /// to cache local data.
        /// </summary>
        public string Manifest {
            get { return _manifest; }
            set { _manifest = value; }
        }

        /// <summary>
        /// Determines the HTML version that this document adheres to.
        /// </summary>
        [Obsolete("Deprecated in HTML4 - use a DOCTYPE declaration instead.")]
        public string Version {
            get { return _version; }
            set { _version = value; }
        }

        /// <summary>
        /// Gets a formatted string of all local attributes of this element
        /// (not including the base attributes).
        /// </summary>
        /// <param name="sb">The StringBuilder to write this element's
        /// attribute data to.</param>
        protected override void WriteLocalAttributes(StringBuilder sb) {
            AttributeWriter.Write(sb, _manifest, "manifest");
            AttributeWriter.Write(sb, _version, "version");
        }
    }
}
